"""
BeaverFramework Utilities Module

This module provides utility functions for the BeaverFramework, including configuration
file handling, data processing, and common operations used across the framework.

Authors:
    MichaelZhang

Key Features:
    - Configuration file loading and parsing
    - YAML file handling
    - Data validation and processing
    - Common utility functions

Usage:
    from BeaverFramework.Framework.utles import load_config
    
    # Load configuration from a YAML file
    config = load_config('config.yaml')
"""

import yaml

def load_config(file_path):
    """
    Load and parse a YAML configuration file.

    This function reads a YAML configuration file and returns its contents as a Python
    dictionary. It handles file opening and YAML parsing, ensuring proper error handling.

    Args:
        file_path (str): Path to the YAML configuration file to be loaded

    Returns:
        dict: Dictionary containing the parsed configuration data

    Raises:
        FileNotFoundError: If the specified file does not exist
        yaml.YAMLError: If the file contains invalid YAML syntax
        
    Example:
        >>> config = load_config('turbine_config.yaml')
        >>> print(config['blade_length'])
        50.0
    """
    with open(file_path, 'r') as file:
        return yaml.safe_load(file)
